#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   qr.py
@Time    :   2020/09/17 22:38:57
@Author  :   Wicos 
@Version :   1.0
@Contact :   wicso@wicos.cn
@License :   (C)Copyright 2017-2018, Liugroup-NLPR-CASIA
@Blog    :   https://www.wicos.me
'''

# here put the import lib
from MyQR import myqr
import os

def creat_qr(data,filename):
    try:
        myqr.run(words=data,save_name=filename,save_dir=os.getcwd()+"/static/qrcode")
        return {"code":0,"msg":"/static/qrcode/" + filename}
    except:
        return {"code":1,"msg":"creat qrcode failed."}
